def add_two_numbers(a, b):
    return a + b
print(add_two_numbers(10, 20))


def test(a, b, c=33, *args, **kwargs):
    print(a, b, c, args, kwargs)


test(1, 2)
test(1, 2, 3)
test(1, 2, 3, 4)
test(1, 2, 3, 4, e=5)

number = 10  # 定义全局变量
def test_one():
    global number  # 使用global声明变量number为全局变量
    number += 1
    print(number)
test_one()
print(number)


def test():
    number = 10
    def test_in():
        nonlocal number
        number = 20
    test_in()
    print(number)
test()

def factional(n):
    if n == 0:
        return 1
    else:
        return n * factional(n - 1)
print(factional(5))

# 定义匿名函数，并将它返回的函数对象赋值给变量temp
temp = lambda x : pow(x, 2)
print(temp(10))
